<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增优惠券')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-coupons-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label">优惠券标题：</label>
                <div class="col-sm-8">
                    <input name="title" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">优惠券的描述：</label>
                <div class="col-sm-8">
                    <input name="description" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">门槛：</label>
                <div class="col-sm-8">
                    <input name="doorSill" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">操作值 满减金额/折扣1-99：</label>
                <div class="col-sm-8">
                    <input name="reduce" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">最多优惠(针对打折类) 0-不限制：</label>
                <div class="col-sm-8">
                    <input name="upperLimit" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">商品使用规则 json 格式：</label>
                <div class="col-sm-8">
                    <textarea name="goodsScope" class="form-control"></textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">发放张数。总数量 -1 不限：</label>
                <div class="col-sm-8">
                    <input name="num" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">优惠券总数：</label>
                <div class="col-sm-8">
                    <input name="countNum" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">方式 1-手动发放 2-自动发放 3-自主领取：</label>
                <div class="col-sm-8">
                    <input name="auto" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">跳转地址：</label>
                <div class="col-sm-8">
                    <input name="jumpTo" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">每次领取数量/天：</label>
                <div class="col-sm-8">
                    <input name="pullOnce" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">最多领取数量：</label>
                <div class="col-sm-8">
                    <input name="pullMax" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">开始时间 0 取end_time长度时间票：</label>
                <div class="col-sm-8">
                    <input name="startTime" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">结束时间 开始时间为0时则为票的有效长：</label>
                <div class="col-sm-8">
                    <input name="endTime" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">开始发放时间：</label>
                <div class="col-sm-8">
                    <input name="startSendTime" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">结束发放时间, 如果为0,只需大于开始时间即通过：</label>
                <div class="col-sm-8">
                    <input name="endSendTime" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">优惠券权重排序 从大到小：</label>
                <div class="col-sm-8">
                    <input name="weight" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">领取方式 1-直接发放 2-用户手动领取：</label>
                <div class="col-sm-8">
                    <input name="receiveWay" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">发放条件：</label>
                <div class="col-sm-8">
                    <textarea name="sendScope" class="form-control"></textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">优惠券互斥类型：</label>
                <div class="col-sm-8">
                    <input name="mutex" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">互斥规则 json格式：</label>
                <div class="col-sm-8">
                    <textarea name="mutexScope" class="form-control"></textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">展示位置：</label>
                <div class="col-sm-8">
                    <input name="showPosition" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">优惠券使用规则：</label>
                <div class="col-sm-8">
                    <textarea name="couponRule" class="form-control"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "mall/coupons"
        $("#form-coupons-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-coupons-add').serialize());
            }
        }
    </script>
</body>
</html>